<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ITing金融</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js">
</script>
<script type="text/javascript">
	//实时显示时间
	$(function() {
		function mytime() {
			var a = new Date();
			var b = a.toLocaleTimeString();
			var c = a.toLocaleDateString();
			document.getElementById("newTime").innerHTML = "当前时间" + c + "&nbsp" + b;
		}
		setInterval(function() {
			mytime()
		}, 1000);

	})
	$(document).ready(function() {

		$("#choices tr").each(function() {
			$(this).find('a').click(function() {
				$(this).parent().prev().find('a').removeClass('cur');
				$(this).parent().find('a').removeClass('cur');
				$(this).parent().next().find('a').removeClass('cur');
				$(this).addClass('cur');
				//TODO: 异步加载数据
				var productTypeID = $(".bank_list_tp1 a[class='cur']").attr("productTypeID");
				var loanPeriodID = $(".bank_list_tp2 a[class='cur']").attr("loanPeriodID");
				var loanMinRate = $(".bank_list_tp3 a[class='cur']").attr("loanMinRate");
				var loanMaxRate = $(".bank_list_tp3 a[class='cur']").attr("loanMaxRate");
				var loanMinScale = $(".bank_list_tp4 a[class='cur']").attr("loanMinScale");
				var loanMaxScale = $(".bank_list_tp4 a[class='cur']").attr("loanMaxScale");
				//	alert("loanMinRate=" + loanMinRate + " ,loanMaxRate=" + loanMaxRate + " ,loanMinScale=" + loanMinScale + " ,loanMaxScale=" + loanMaxScale);
				$("#myUL li").remove();
				$.ajax({
					url : "selectAssignProduct.action?productTypeID=" + productTypeID + "&loanPeriodID=" + loanPeriodID + "&loanMinRate=" + loanMinRate + "&loanMaxRate=" + loanMaxRate + "&loanMinScale=" + loanMinScale + "&loanMaxScale=" + loanMaxScale,
					data : "get",
					dataType : "json",
					success : function(result) {
						for (var i = 0; i < result.length; i++) {
							var URL = '/resource/' + result[i].imgURL;
							var IMGURL = "<div class='fl'><img src=" + URL + " width='75px' height='40px' class='pr_logo' /></div>";
							var li = "<li class='clear'>" + IMGURL + "<div class='fl'><dl><dt>产品名称： <span class='king'>" + result[i].productName + "</span></dt>" +
								"<dt>所属银行：" + result[i].companyName + "</dt>" +
								"<dt>产品类别：" + result[i].productTypeName + " </dt>" +
								"<dt>放贷利率：" + result[i].loanMinRate + "%-" + result[i].loanMaxRate + "%（年化利率）</dt>" +
								"<dt>放贷金额：" + result[i].loanMinScale + "-" + result[i].loanMaxScale + "万</dt>" +
								"<dt>放贷期限：" + result[i].loanPeriodWeek + "个月</dt>" +
								"</dl></div><div class='view_details'><a href='selectProductDetailOnline.action?productID=" + result[i].productID + ">查看详细</a></div></li>"
							$("#myUL").append(li)
						}
					}
				});
			});
		});

	});
</script>
</head>
<body>
	<div class="wrap header oauto clear">
		<div class="fr">
			<a href="#" id="newTime"> </a>
		</div>
	</div>
	<div class="logo-nav">
		<div class="wrap oauto">
			<div class="clear">
				<div class="fl">
					<img src="images/logo.png" />
				</div>
			</div>
		</div>
	</div>
	<div class="menu">
		<ul class="clear">
			<li><a href="selectFinancingProduct.action" class="cur">融资产品</a></li>
			<li><a href="pages/news.jsp" target="_blank">每日新闻</a></li>
		</ul>
	</div>
	<div class="wrap bank_list">
		<div class="title clear">
			<h1 class="fl">产品分类</h1>
		</div>
		<div class="bank_list_tp">
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				id="choices">
				<tr class="bank_list_tp1">
					<td width="10%" align="right">产品类型：</td>
					<td width="12%" align="center" valign="top" class="qb"><a
						href="javascript:;" class="cur" id="productType" productTypeID="0">全部</a></td>
					<td width="78%" class="txt clear"><c:forEach
							items="${productTypeList }" var="productType">
							<a href="javascript:;"
								productTypeID=${productType.productTypeID }>${productType.productTypeName }</a>
						</c:forEach></td>
				</tr>
				<tr class="bank_list_tp2">
					<td align="right">贷款周期：</td>
					<td align="center" valign="top" class="qb"><a
						href="javascript:;" class="cur" id="loanPeriod" loanPeriodID="0">全部</a></td>
					<td class="txt clear"><c:forEach items="${loanPeriodList }"
							var="loanPeriod">
							<a href="javascript:;" loanPeriodID="${loanPeriod.loanPeriodID }">${loanPeriod.loanPeriodWeek }个月</a>
						</c:forEach></td>
				</tr>
				<tr class="bank_list_tp3">
					<td align="right">贷款利率：</td>
					<td align="center" valign="top" class="qb"><a
						href="javascript:;" class="cur" id="loanRate" loanMinRate="0"
						loanMaxRate="0">全部</a></td>
					<td class="txt clear"><a href="javascript:;" loanMinRate="0"
						loanMaxRate="6">6%以下</a><a href="javascript:;" loanMinRate="6"
						loanMaxRate="8">6%-8%</a><a href="javascript:;" loanMinRate="8"
						loanMaxRate="10">8%-10%</a><a href="javascript:;" loanMinRate="10"
						loanMaxRate="12">10%-12%</a><a href="javascript:;"
						loanMinRate="12" loanMaxRate="14">12%-14%</a><a
						href="javascript:;" loanMinRate="14" loanMaxRate="100">14%以上</a></td>
				</tr>
				<tr class="bank_list_tp4">
					<td align="right">贷款规模：</td>
					<td align="center" valign="top" class="qb"><a
						href="javascript:;" class="cur" id="loanScale" loanMinScale="0"
						loanMaxScale="0">全部</a></td>
					<td class="txt clear"><a href="javascript:;" loanMinScale="0"
						loanMaxScale="100">100万以下</a><a href="javascript:;"
						loanMinScale="100" loanMaxScale="200">100万-200万</a><a
						href="javascript:;" loanMinScale="200" loanMaxScale="300">200万-300万</a><a
						href="javascript:;" loanMinScale="300" loanMaxScale="500">300万-500万</a><a
						href="javascript:;" loanMinScale="500" loanMaxScale="1000">500万-1000万</a><a
						href="javascript:;" loanMinScale="1000" loanMaxScale="0">1000万以上</a></td>
				</tr>
			</table>
		</div>
	</div>
	<div class="wrap project_release">
		<div class="project_release_tp">融资产品</div>
		<div class="project_release_bt">
			<ul id="myUL">
				<c:forEach items="${productList }" var="product">
					<li class="clear">
						<div class="fl">
							<c:forEach items="${companyList }" var="company">
								<c:if test="${product.companyID == company.companyID}">
									<img src="${resourse}${company.imgURL}" width="75px"
										height="40px" class="pr_logo" />
								</c:if>
							</c:forEach>

						</div>
						<div class="fl">
							<dl>
								<dt>
									产品名称： <span class="king">${product.productName }</span>
								</dt>
								<dt>所属银行：${product.companyName }</dt>
								<dt>产品类别：${product.productTypeName }</dt>
								<dt>放贷利率：${product.loanMinRate }%-${product.loanMaxRate }%（年化利率）</dt>
								<dt>放贷金额：${product.loanMinScale }-${product.loanMaxScale }万</dt>
								<dt>放贷期限：${product.loanPeriodWeek }个月</dt>
							</dl>
						</div>
						<div class="view_details">
							<a
								href="selectProductDetailOnline.action?productID=${product.productID }">查看详细</a>
						</div>
					</li>
				</c:forEach>
			</ul>
		</div>
		<div class="newslist_text">
			<a href="#">上一页</a><a href="#" class="cur">1</a><a href="#">2</a><a
				href="#">3</a><a href="#">4</a><a href="#">5</a><a href="#">6</a><a
				href="#">7</a><a href="#">...</a><a href="#">下一页</a>
		</div>
	</div>
	<div class="footer">
		Copyright &copy; 2014 南京网博 版权所有 <a href="mailto:1103613624@qq.com">1103613624@qq.com</a>
	</div>
</body>
</html>
